<?php

namespace App\Services\spider;

use App\Model\CommonSpiderItem;

interface IDataRepo
{
    public function getCount($taskNo);


    public function filterExists($taskNo, array $urls);

    /**
     * @param $taskNo
     * @param $url
     * @return CommonSpiderItem|null
     */
    public function getHtmlItem($taskNo, $url);

    /**
     * @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|CommonSpiderItem[]
     */
    public function unHandleItems($taskNo, $limit = 50);

    /**
     * @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection|CommonSpiderItem[]
     */
    public function errorItems($taskNo, $limit = 50);


    public function handledItem($taskNo, $url): bool;

    public function updateItem(string $taskNo, string $url, array $arr): bool;


}